package com.gitee.xhs.customWaterMark;

import com.gitee.xhs.CustomDefaultTimestampAssigner;
import com.gitee.xhs.CustomDefaultWatermarkGenerator;
import com.gitee.xhs.sampleRecod.transactionRecord.Transaction;
import org.apache.flink.api.common.eventtime.*;

/**
 * @author BigHead
 * @date 2022/7/14 16:44
 * @description CustomWaterStrategy
 */
public class CustomWaterStrategy implements WatermarkStrategy<Transaction> {

    public static final String CUSTOM_WATER_STRATEGY = "CustomWaterStrategy";

    @Override
    public TimestampAssigner<Transaction> createTimestampAssigner(TimestampAssignerSupplier.Context context) {
        return new CustomDefaultTimestampAssigner();
    }

    @Override
    public WatermarkGenerator<Transaction> createWatermarkGenerator(WatermarkGeneratorSupplier.Context context) {
        return new CustomDefaultWatermarkGenerator();
    }

}
